<ion-nav-bar class="nav-title-slide-ios7 bar-assertive">
</ion-nav-bar>
<ion-view title="">
  <ion-content>
    <div style="text-align: center;"><img style="width: 60%;position: relative;top:100px" src="../assets/images/people1.png"/></div>
    <div growl
         style="z-index: 10;position: absolute;width: 60%;margin-left: 20%;"></div>
    <div class="subscribe">
      <form novalidate ng-submit="vm.subscribe(subscribeForm)" name="subscribeForm">
        <div class="list list-inset">
          <div class="subscribe-form">
            <div class="item item-input input-wrap">
              <i class="icon ion-search placeholder-icon input-icon"></i>
              <input autocomplete="off" type="text" class="subscribe-input" required name="userName"
                     ng-model="vm.form.userName" ng-required="true" placeholder="输入客户姓名" >
            </div>
            <div >
              <span style="color:red" ng-show="subscribeForm.userName.$invalid && subscribeForm.userName.$dirty">此项为必填项</span>
            </div>
          </div>

          <div class="subscribe-form">
            <div class="item item-input  input-wrap">
              <i class="icon ion-iphone placeholder-icon input-icon"></i>
              <input type="tel" class="subscribe-input" name="telephone" ng-model="vm.form.telephone" required="required" maxlength="11" ng-pattern="/^1[3-8]\d{9}$/"
                      placeholder="输入客户手机号">
            </div>
            <div >
              <span style="color:red" ng-show="subscribeForm.telephone.$invalid && subscribeForm.telephone.$dirty">此项为必填项,必须为有效的手机号</span>
            </div>
          </div>
        </div>

        <div class="but-submit">
          <button type="submit" class="button button-block button-assertive bt-font">确认邀请</button>
        </div>
      </form>
      </div>
    </div>
  </ion-content>
</ion-view>

<script type="text/ng-template" id="modalDialogId">
  <div style="background-color: #DA251c;height: 42px"></div>
  <div class="ngdialog-message">
    <p>客户{{phoneNum}}，已被他人预约，保护期还剩{{validity}}天，期间客户未完成注册，可在保护期解除后再对其进行预约。</p>
  </div>
  <div class="ngdialog-buttons">
    <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog('Cancel')">取消</button>
    <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm('Save')">确定</button>
  </div>
</script>

<script type="text/ng-template" id="duplicatedMobileId">
  <div style="background-color: #DA251c;height: 42px"></div>
  <div class="ngdialog-message">
    <p>抱歉，预约失败！该客户已注册。</p>
  </div>
  <div class="ngdialog-buttons">
    <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog('Cancel')">取消</button>
    <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm('Save')">确定</button>
  </div>
</script>

<script type="text/ng-template" id="subsribesuccessId">
  <div style="background-color: #DA251c;height: 42px"></div>
  <div class="ngdialog-message">
    <p>您已预约{{mobile}}，保护期为7天，期间客户完成注册，预约成功，否则预约失败。</p>
  </div>
  <div class="ngdialog-buttons">
    <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog('Cancel')">取消</button>
    <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm('Save')">确定</button>
  </div>
</script>

